{include file="public/head"}

<body>
<div id="wrapper">

    <div class="gray-bg dashbard-1">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form class="form-horizontal m-t" id="commentForm">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">会员账号：</label>
                                    <div class="col-sm-8">
                                        <input id="username" name="username" maxlength="50" type="text" class="form-control" required="" aria-required="true" value="{$UserInfo.username}" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">会员级别：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control m-b" id="level" name="level">
                                            {volist name="LevelList" id="v"}
                                                <option value="{$v.id}" {if condition="$UserInfo.level eq $v.id"}selected{/if}>{$v.name}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">会员姓名：</label>
                                    <div class="col-sm-8">
                                        <input id="name" name="name" maxlength="32" type="text" class="form-control"  required="" aria-required="true" value="{$UserInfo.name}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">会员手机：</label>
                                    <div class="col-sm-8">
                                        <input id="phone" name="phone" minlength="11" maxlength="11" type="text" class="form-control" required="" aria-required="true" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="{$UserInfo.phone}" >
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">区域代理：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control m-b" id="level_1" name="level_1">
                                            <option value="0" {if condition="$UserInfo.level_1 eq 0"}selected{/if}>不是</option>
                                            <option value="1" {if condition="$UserInfo.level_1 eq 1"}selected{/if}>区县经理</option>
                                            <option value="2" {if condition="$UserInfo.level_1 eq 2"}selected{/if}>市总监</option>
                                            <option value="3" {if condition="$UserInfo.level_1 eq 3"}selected{/if}>省总监</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">管理区域：</label>
                                    <div class="col-sm-8">
                                        <input id="quyu" name="quyu" minlength="" maxlength="18" type="text" class="form-control"  aria-required="true" value="{$UserInfo.quyu}" >
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">推荐账号：</label>
                                    <div class="col-sm-8">
                                        <input id="recommend" name="recommend" type="text" class="form-control" value="{$UserInfo.recommend}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">备注信息：</label>
                                    <div class="col-sm-8">
                                        <textarea id="remark" class="form-control" style="height: 100px">{$UserInfo.remark}</textarea>
                                    </div>
                                </div>
                                <input type="hidden" id="id" value="{$UserInfo.id}">
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">确认修改</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>
<script src="__STATIC__/Admin/js/jquery-2.1.1.min.js"></script>
<script src="__STATIC__/Admin/js/bootstrap.min.js?v=3.4.0"></script>
<script src="__STATIC__/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__STATIC__/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/Admin/layer/layer.js"></script>
<script>
    $('form').submit(function (e) {
        e.preventDefault();
        $.ajax({
            type:"post",
            url:"{:url('User/UserEdit')}",
            data:{
                id:$('#id').val(),
                name:$('#name').val(),
                phone:$('#phone').val(),
                // id_card:$('#id_card').val(),
                wechat:$('#wechat').val(),
                wechat_openid:$('#wechat_openid').val(),
                remark:$('#remark').val(),
                level:$('#level').val(),
                quyu:$('#quyu').val(),
                recommend:$('#recommend').val(),
                level_1:$('#level_1').val(),
            },
            dataType:"json",
            success:function(data){
                if(data.status == 1){
                    layer.msg(data.message,{icon: 6,time:1500},function () {
                        window.top.location.reload();
                    });
                }else{
                    layer.msg(data.message,{icon: 5,time:1500});
                }
            }
        })
    })
</script>
</body>

</html>